***Figure 1, Figure 3, and Figure A1***
*Senate
clear
use "Senate.dta"
keep if south == 0
g logitcoef = .
forvalues i = 1916(2)2022 {
logit rep pres if eyear == `i'
replace logitcoef = _b[pres] if eyear == `i'
}
g pres_demmembers = pres_memberparty if dem == 1
g pres_repmembers = pres_memberparty if rep == 1
g cvp_dem = cvp if dem == 1
g cvp_rep = cvp if rep == 1
collapse (mean) pres_memberparty pres_demmembers pres_repmembers cvp_dem cvp_rep logitcoef (sd) pres, by(eyear)
rename pres sdpres
rename pres_memberparty overall
rename pres_demmembers dems
rename pres_repmembers reps 
g polarization = cvp_rep - cvp_dem
sort eyear
graph twoway (line overall eyear, yaxis(1)) (line polarization eyear, yaxis(2))
gr_edit .style.editstyle margin(vsmall) boxstyle(shadestyle(color(white)) linestyle(color(white))) editcopy
gr_edit .legend.draw_view.setstyle, style(no)
gr_edit .xaxis1.reset_rule 1920 2020 10, tickset(major) ruletype(range) 
gr_edit .xaxis1.title.text = {}
gr_edit .xaxis1.title.text.Arrpush Election Year
gr_edit .yaxis1.style.editstyle majorstyle(gridstyle(linestyle(color(white)))) editcopy
gr_edit .xaxis1.style.editstyle majorstyle(gridstyle(linestyle(color(white)))) editcopy
gr_edit .yaxis1.title.text = {}
gr_edit .yaxis1.title.text.Arrpush Copartisan Leaning
gr_edit .yaxis2.title.text = {}
gr_edit .yaxis2.title.text.Arrpush Congressional Polarization
gr_edit .plotregion1.plot1.style.editstyle line(color(black) width(thick)) editcopy
gr_edit .plotregion2.plot2.style.editstyle line(color(gs8) width(thick)) editcopy
gr_edit .yaxis2.title.style.editstyle color(gs8) editcopy
gr_edit .yaxis2.style.editstyle majorstyle(tickstyle(linestyle(color(gs8)))) editcopy
gr_edit .yaxis2.style.editstyle majorstyle(tickstyle(textstyle(color(gs8)))) editcopy
gr_edit .yaxis2.style.editstyle majorstyle(use_labels(no)) editcopy
gr_edit .yaxis2.style.editstyle majorstyle(alternate(no)) editcopy
gr_edit .yaxis2.style.editstyle linestyle(color(gs8)) editcopy
gr_edit .title.style.editstyle color(black) editcopy
gr_edit .title.text = {}
gr_edit .title.text.Arrpush Senate
graph save "ConstituencyPartisanship_Polarization_Senate.gph", replace

sort eyear
graph twoway (line sdpres eyear, yaxis(1)) (line logitcoef eyear, yaxis(2))
gr_edit .style.editstyle margin(vsmall) boxstyle(shadestyle(color(white)) linestyle(color(white))) editcopy
gr_edit .legend.draw_view.setstyle, style(no)
gr_edit .xaxis1.reset_rule 1920 2020 10, tickset(major) ruletype(range)
gr_edit .xaxis1.title.text = {}
gr_edit .xaxis1.title.text.Arrpush Election Year
gr_edit .yaxis1.style.editstyle majorstyle(gridstyle(linestyle(color(white)))) editcopy
gr_edit .xaxis1.style.editstyle majorstyle(gridstyle(linestyle(color(white)))) editcopy
gr_edit .yaxis1.title.text = {}
gr_edit .yaxis1.title.text.Arrpush Geographic Polarization
gr_edit .yaxis2.title.text = {}
gr_edit .yaxis2.title.text.Arrpush Nationalized Voting
gr_edit .plotregion1.plot1.style.editstyle line(color(black) width(thick)) editcopy
gr_edit .plotregion2.plot2.style.editstyle line(color(gs8) width(thick)) editcopy
gr_edit .yaxis2.title.style.editstyle color(gs8) editcopy
gr_edit .yaxis2.style.editstyle majorstyle(tickstyle(linestyle(color(gs8)))) editcopy
gr_edit .yaxis2.style.editstyle majorstyle(tickstyle(textstyle(color(gs8)))) editcopy
gr_edit .yaxis2.style.editstyle majorstyle(use_labels(no)) editcopy
gr_edit .yaxis2.style.editstyle majorstyle(alternate(no)) editcopy
gr_edit .yaxis2.style.editstyle linestyle(color(gs8)) editcopy
gr_edit .title.style.editstyle color(black) editcopy
gr_edit .title.text = {}
gr_edit .title.text.Arrpush Senate
graph save "SD_Logit_Senate.gph", replace

graph twoway line dems reps overall eyear
gr_edit .style.editstyle margin(vsmall) boxstyle(shadestyle(color(white)) linestyle(color(white))) editcopy
gr_edit .legend.draw_view.setstyle, style(no)
gr_edit .xaxis1.reset_rule 1920 2020 10, tickset(major) ruletype(range)
gr_edit .yaxis1.reset_rule 0 .15 .05 , tickset(major) ruletype(range)
gr_edit .xaxis1.title.text = {}
gr_edit .xaxis1.title.text.Arrpush Year
gr_edit .yaxis1.title.text = {}
gr_edit .yaxis1.title.text.Arrpush Copartisan Leaning
gr_edit .yaxis1.style.editstyle majorstyle(gridstyle(linestyle(color(white)))) editcopy
gr_edit .xaxis1.style.editstyle majorstyle(gridstyle(linestyle(color(white)))) editcopy
gr_edit .plotregion1.plot1.style.editstyle line(color(blue) width(thick)) editcopy
gr_edit .plotregion1.plot2.style.editstyle line(color(red) width(thick)) editcopy
gr_edit .plotregion1.plot3.style.editstyle line(color(black) width(thick)) editcopy
gr_edit .plotregion1.AddTextBox added_text editor -.01 1982
gr_edit .plotregion1.added_text_new = 1
gr_edit .plotregion1.added_text_rec = 1
gr_edit .plotregion1.added_text[1].style.editstyle  angle(default) size(medsmall) color(blue) horizontal(left) vertical(middle) margin( gleft( sztype(relative) val(0) allow_pct(1)) gright( sztype(relative) val(0) allow_pct(1)) gtop( sztype(relative) val(0) allow_pct(1)) gbottom( sztype(relative) val(0) allow_pct(1))) linegap( sztype(relative) val(0) allow_pct(1)) drawbox(no) boxmargin( gleft( sztype(relative) val(0) allow_pct(1)) gright( sztype(relative) val(0) allow_pct(1)) gtop( sztype(relative) val(0) allow_pct(1)) gbottom( sztype(relative) val(0) allow_pct(1))) fillcolor(bluishgray) linestyle( width( sztype(relative) val(.2) allow_pct(1)) color(black) pattern(solid) align(inside)) box_alignment(east) editcopy
gr_edit .plotregion1.added_text[1].text = {}
gr_edit .plotregion1.added_text[1].text.Arrpush Democrats
gr_edit .plotregion1.AddTextBox added_text editor .1 1995
gr_edit .plotregion1.added_text_new = 2
gr_edit .plotregion1.added_text_rec = 2
gr_edit .plotregion1.added_text[2].style.editstyle  angle(default) size(medsmall) color(red) horizontal(left) vertical(middle) margin( gleft( sztype(relative) val(0) allow_pct(1)) gright( sztype(relative) val(0) allow_pct(1)) gtop( sztype(relative) val(0) allow_pct(1)) gbottom( sztype(relative) val(0) allow_pct(1))) linegap( sztype(relative) val(0) allow_pct(1)) drawbox(no) boxmargin( gleft( sztype(relative) val(0) allow_pct(1)) gright( sztype(relative) val(0) allow_pct(1)) gtop( sztype(relative) val(0) allow_pct(1)) gbottom( sztype(relative) val(0) allow_pct(1))) fillcolor(bluishgray) linestyle( width( sztype(relative) val(.2) allow_pct(1)) color(black) pattern(solid) align(inside)) box_alignment(east) editcopy
gr_edit .plotregion1.added_text[2].text = {}
gr_edit .plotregion1.added_text[2].text.Arrpush Republicans
gr_edit .plotregion1.AddTextBox added_text editor .055 2003
gr_edit .plotregion1.added_text_new = 3
gr_edit .plotregion1.added_text_rec = 3
gr_edit .plotregion1.added_text[3].style.editstyle  angle(default) size(medsmall) color(black) horizontal(left) vertical(middle) margin( gleft( sztype(relative) val(0) allow_pct(1)) gright( sztype(relative) val(0) allow_pct(1)) gtop( sztype(relative) val(0) allow_pct(1)) gbottom( sztype(relative) val(0) allow_pct(1))) linegap( sztype(relative) val(0) allow_pct(1)) drawbox(no) boxmargin( gleft( sztype(relative) val(0) allow_pct(1)) gright( sztype(relative) val(0) allow_pct(1)) gtop( sztype(relative) val(0) allow_pct(1)) gbottom( sztype(relative) val(0) allow_pct(1))) fillcolor(bluishgray) linestyle( width( sztype(relative) val(.2) allow_pct(1)) color(black) pattern(solid) align(inside)) box_alignment(east) editcopy
gr_edit .plotregion1.added_text[3].text = {}
gr_edit .plotregion1.added_text[3].text.Arrpush Both
gr_edit .title.style.editstyle color(black) editcopy
gr_edit .title.text = {}
gr_edit .title.text.Arrpush Senate
graph save "ConstituencyPartisanship_Senate.gph", replace

*House
clear
use "House.dta"
keep if south == 0
g logitcoef = .
forvalues i = 1952(2)2020 {
logit rep pres if eyear == `i'
replace logitcoef = _b[pres] if eyear == `i'
}
g pres_demmembers = pres_memberparty if dem == 1
g pres_repmembers = pres_memberparty if rep == 1
g cvp_dem = cvp if dem == 1
g cvp_rep = cvp if rep == 1
collapse (mean) pres_memberparty pres_demmembers pres_repmembers cvp_dem cvp_rep logitcoef (sd) pres, by(eyear)
rename pres sdpres
rename pres_memberparty overall
rename pres_demmembers dems
rename pres_repmembers reps 
g polarization = cvp_rep - cvp_dem
sort eyear
graph twoway (line overall eyear, yaxis(1)) (line polarization eyear, yaxis(2))
gr_edit .style.editstyle margin(vsmall) boxstyle(shadestyle(color(white)) linestyle(color(white))) editcopy
gr_edit .legend.draw_view.setstyle, style(no)
gr_edit .xaxis1.reset_rule 1952 2012 10, tickset(major) ruletype(range) 
gr_edit .xaxis1.add_ticks 2020 `"2020"', tickset(major)
gr_edit .xaxis1.title.text = {}
gr_edit .xaxis1.title.text.Arrpush Election Year
gr_edit .yaxis1.style.editstyle majorstyle(gridstyle(linestyle(color(white)))) editcopy
gr_edit .xaxis1.style.editstyle majorstyle(gridstyle(linestyle(color(white)))) editcopy
gr_edit .yaxis1.title.text = {}
gr_edit .yaxis1.title.text.Arrpush Copartisan Leaning
gr_edit .yaxis2.title.text = {}
gr_edit .yaxis2.title.text.Arrpush Congressional Polarization
gr_edit .plotregion1.plot1.style.editstyle line(color(black) width(thick)) editcopy
gr_edit .plotregion2.plot2.style.editstyle line(color(gs8) width(thick)) editcopy
gr_edit .yaxis2.title.style.editstyle color(gs8) editcopy
gr_edit .yaxis2.style.editstyle majorstyle(tickstyle(linestyle(color(gs8)))) editcopy
gr_edit .yaxis2.style.editstyle majorstyle(tickstyle(textstyle(color(gs8)))) editcopy
gr_edit .yaxis2.style.editstyle majorstyle(use_labels(no)) editcopy
gr_edit .yaxis2.style.editstyle majorstyle(alternate(no)) editcopy
gr_edit .yaxis2.style.editstyle linestyle(color(gs8)) editcopy
gr_edit .title.style.editstyle color(black) editcopy
gr_edit .title.text = {}
gr_edit .title.text.Arrpush House
graph save "ConstituencyPartisanship_Polarization_House.gph", replace
graph combine "ConstituencyPartisanship_Polarization_House.gph" "ConstituencyPartisanship_Polarization_Senate.gph", col(1)
gr_edit .style.editstyle margin(vsmall) boxstyle(shadestyle(color(white)) linestyle(color(white))) editcopy
gr_edit .style.editstyle declared_ysize(9) editcopy
graph export "Figure1.png", replace as(png)

sort eyear
graph twoway (line sdpres eyear, yaxis(1)) (line logitcoef eyear, yaxis(2))
gr_edit .style.editstyle margin(vsmall) boxstyle(shadestyle(color(white)) linestyle(color(white))) editcopy
gr_edit .legend.draw_view.setstyle, style(no)
gr_edit .xaxis1.reset_rule 1952 2012 10, tickset(major) ruletype(range) 
gr_edit .xaxis1.add_ticks 2020 `"2020"', tickset(major)
gr_edit .xaxis1.plotregion.xscale.curmax = 2021
gr_edit .xaxis1.title.text = {}
gr_edit .xaxis1.title.text.Arrpush Election Year
gr_edit .yaxis1.style.editstyle majorstyle(gridstyle(linestyle(color(white)))) editcopy
gr_edit .xaxis1.style.editstyle majorstyle(gridstyle(linestyle(color(white)))) editcopy
gr_edit .yaxis1.title.text = {}
gr_edit .yaxis1.title.text.Arrpush Geographic Polarization
gr_edit .yaxis2.title.text = {}
gr_edit .yaxis2.title.text.Arrpush Nationalized Voting
gr_edit .plotregion1.plot1.style.editstyle line(color(black) width(thick)) editcopy
gr_edit .plotregion2.plot2.style.editstyle line(color(gs8) width(thick)) editcopy
gr_edit .yaxis2.title.style.editstyle color(gs8) editcopy
gr_edit .yaxis2.style.editstyle majorstyle(tickstyle(linestyle(color(gs8)))) editcopy
gr_edit .yaxis2.style.editstyle majorstyle(tickstyle(textstyle(color(gs8)))) editcopy
gr_edit .yaxis2.style.editstyle majorstyle(use_labels(no)) editcopy
gr_edit .yaxis2.style.editstyle majorstyle(alternate(no)) editcopy
gr_edit .yaxis2.style.editstyle linestyle(color(gs8)) editcopy
gr_edit .title.style.editstyle color(black) editcopy
gr_edit .title.text = {}
gr_edit .title.text.Arrpush House
graph save "SD_Logit_House.gph", replace
graph combine "SD_Logit_House.gph" "SD_Logit_Senate.gph", col(1)
gr_edit .style.editstyle margin(vsmall) boxstyle(shadestyle(color(white)) linestyle(color(white))) editcopy
gr_edit .style.editstyle declared_ysize(9) editcopy
graph export "Figure3.png", replace as(png)

graph twoway line dems reps overall eyear
gr_edit .style.editstyle margin(vsmall) boxstyle(shadestyle(color(white)) linestyle(color(white))) editcopy
gr_edit .legend.draw_view.setstyle, style(no)
gr_edit .xaxis1.reset_rule 1952 2012 10, tickset(major) ruletype(range) 
gr_edit .yaxis1.reset_rule 0 .15 .05 , tickset(major) ruletype(range)
gr_edit .xaxis1.title.text = {}
gr_edit .xaxis1.title.text.Arrpush Year
gr_edit .yaxis1.title.text = {}
gr_edit .yaxis1.title.text.Arrpush Copartisan Leaning
gr_edit .yaxis1.style.editstyle majorstyle(gridstyle(linestyle(color(white)))) editcopy
gr_edit .xaxis1.style.editstyle majorstyle(gridstyle(linestyle(color(white)))) editcopy
gr_edit .plotregion1.plot1.style.editstyle line(color(blue) width(thick)) editcopy
gr_edit .plotregion1.plot2.style.editstyle line(color(red) width(thick)) editcopy
gr_edit .plotregion1.plot3.style.editstyle line(color(black) width(thick)) editcopy
gr_edit .xaxis1.add_ticks 2020 `"2020"', tickset(major)
gr_edit .xaxis1.plotregion.xscale.curmax = 2021
gr_edit .plotregion1.AddTextBox added_text editor .115759615084752 1985.5
gr_edit .plotregion1.added_text_new = 1
gr_edit .plotregion1.added_text_rec = 1
gr_edit .plotregion1.added_text[1].style.editstyle  angle(default) size(medsmall) color(blue) horizontal(left) vertical(middle) margin( gleft( sztype(relative) val(0) allow_pct(1)) gright( sztype(relative) val(0) allow_pct(1)) gtop( sztype(relative) val(0) allow_pct(1)) gbottom( sztype(relative) val(0) allow_pct(1))) linegap( sztype(relative) val(0) allow_pct(1)) drawbox(no) boxmargin( gleft( sztype(relative) val(0) allow_pct(1)) gright( sztype(relative) val(0) allow_pct(1)) gtop( sztype(relative) val(0) allow_pct(1)) gbottom( sztype(relative) val(0) allow_pct(1))) fillcolor(bluishgray) linestyle( width( sztype(relative) val(.2) allow_pct(1)) color(black) pattern(solid) align(inside)) box_alignment(east) editcopy
gr_edit .plotregion1.added_text[1].text = {}
gr_edit .plotregion1.added_text[1].text.Arrpush Democrats
gr_edit .plotregion1.AddTextBox added_text editor .0488160358021409 1989.012235392317
gr_edit .plotregion1.added_text_new = 2
gr_edit .plotregion1.added_text_rec = 2
gr_edit .plotregion1.added_text[2].style.editstyle  angle(default) size(medsmall) color(red) horizontal(left) vertical(middle) margin( gleft( sztype(relative) val(0) allow_pct(1)) gright( sztype(relative) val(0) allow_pct(1)) gtop( sztype(relative) val(0) allow_pct(1)) gbottom( sztype(relative) val(0) allow_pct(1))) linegap( sztype(relative) val(0) allow_pct(1)) drawbox(no) boxmargin( gleft( sztype(relative) val(0) allow_pct(1)) gright( sztype(relative) val(0) allow_pct(1)) gtop( sztype(relative) val(0) allow_pct(1)) gbottom( sztype(relative) val(0) allow_pct(1))) fillcolor(bluishgray) linestyle( width( sztype(relative) val(.2) allow_pct(1)) color(black) pattern(solid) align(inside)) box_alignment(east) editcopy
gr_edit .plotregion1.added_text[2].text = {}
gr_edit .plotregion1.added_text[2].text.Arrpush Republicans
gr_edit .plotregion1.AddTextBox added_text editor .0766113231066168 1994.923074597831
gr_edit .plotregion1.added_text_new = 3
gr_edit .plotregion1.added_text_rec = 3
gr_edit .plotregion1.added_text[3].style.editstyle  angle(default) size(medsmall) color(black) horizontal(left) vertical(middle) margin( gleft( sztype(relative) val(0) allow_pct(1)) gright( sztype(relative) val(0) allow_pct(1)) gtop( sztype(relative) val(0) allow_pct(1)) gbottom( sztype(relative) val(0) allow_pct(1))) linegap( sztype(relative) val(0) allow_pct(1)) drawbox(no) boxmargin( gleft( sztype(relative) val(0) allow_pct(1)) gright( sztype(relative) val(0) allow_pct(1)) gtop( sztype(relative) val(0) allow_pct(1)) gbottom( sztype(relative) val(0) allow_pct(1))) fillcolor(bluishgray) linestyle( width( sztype(relative) val(.2) allow_pct(1)) color(black) pattern(solid) align(inside)) box_alignment(east) editcopy
gr_edit .plotregion1.added_text[3].text = {}
gr_edit .plotregion1.added_text[3].text.Arrpush Both
gr_edit .title.style.editstyle color(black) editcopy
gr_edit .title.text = {}
gr_edit .title.text.Arrpush House
graph save "ConstituencyPartisanship_House.gph", replace
graph combine "ConstituencyPartisanship_House.gph" "ConstituencyPartisanship_Senate.gph", col(1)
gr_edit .style.editstyle margin(vsmall) boxstyle(shadestyle(color(white)) linestyle(color(white))) editcopy
gr_edit .style.editstyle declared_ysize(9) editcopy
gr_edit .plotregion1.graph1.plotregion1.added_text[1].DragBy .0023104363055373 -.6043987663987808
gr_edit .plotregion1.graph1.plotregion1.added_text[2].DragBy -.0032346108277523 .2014662554662744
gr_edit .plotregion1.graph2.plotregion1.added_text[2].DragBy .0051623904532852 1.237995540836221
gr_edit .plotregion1.graph2.plotregion1.added_text[1].DragBy -.0051623904532852 -.9284966556271124
graph export "FigureA1.png", replace as(png)


***Table 1 and Figure 2***
*House
clear
postutil clear
use "House.dta"
keep if south == 0
keep if eyear >= 1972
sum eyear
g time = (eyear - r(min))/(r(max) - r(min))
g extremism = cvp
replace extremism = -1*cvp if dem == 1
egen congress_party = group(eyear dem)
reghdfe extremism pres_memberparty, a(congress_party icpsr) cluster(icpsr)
outreg2 using "Table1House.txt", dec(3) 2aster replace
scalar A = _b[pres_memberparty]
areg extremism pres_memberparty, a(congress_party) cluster(icpsr)
outreg2 using "Table1House.txt", dec(3) 2aster append
scalar B = _b[pres_memberparty]
reg extremism time dem, cluster(icpsr)
outreg2 using "Table1House.txt", dec(3) 2aster append
scalar C = _b[time]
reg pres_memberparty time dem, cluster(icpsr)
outreg2 using "Table1House.txt", dec(3) 2aster append
scalar D = _b[time]
disp A/B
disp (B*D)/C
clear
postutil clear
use "House.dta"
keep if south == 0
keep if eyear >= 1972
g extremism = cvp
replace extremism = -1*cvp if dem == 1
postfile Results responsiveness shareexplained year using "Results.dta", replace
forvalues i = 1972(2)2020 {
reg extremism pres_memberparty dem if eyear == `i', cluster(icpsr)
post Results (_b[pres_memberparty]) ((_b[pres_memberparty]*D)/C) (`i')
}
postclose Results
clear
use "Results.dta"
sum responsiveness
scalar min1 = r(min)
scalar max1 = r(max)
sum shareexplained
scalar min2 = r(min)
scalar max2 = r(max)
graph twoway (line responsiveness year, yaxis(1)) (line shareexplained year, yaxis(2))
gr_edit .yaxis1.reset_rule .2 .7 .1, tickset(major) ruletype(range)
gr_edit .yaxis2.reset_rule .2 .6 .1, tickset(major) ruletype(range)
gr_edit .yaxis1.plotregion.yscale.curmax = max1
gr_edit .yaxis1.plotregion.yscale.curmin = min1
gr_edit .yaxis2.plotregion.yscale.curmax = max2
gr_edit .yaxis2.plotregion.yscale.curmin = min2
gr_edit .style.editstyle margin(vsmall) boxstyle(shadestyle(color(white)) linestyle(color(white))) editcopy
gr_edit .legend.draw_view.setstyle, style(no)
gr_edit .xaxis1.reset_rule 1972 2012 10, tickset(major) ruletype(range) 
gr_edit .xaxis1.add_ticks 2020 `"2020"', tickset(major)
gr_edit .xaxis1.title.text = {}
gr_edit .xaxis1.title.text.Arrpush Election Year
gr_edit .yaxis1.style.editstyle majorstyle(gridstyle(linestyle(color(white)))) editcopy
gr_edit .xaxis1.style.editstyle majorstyle(gridstyle(linestyle(color(white)))) editcopy
gr_edit .yaxis1.title.text = {}
gr_edit .yaxis1.title.text.Arrpush Responsiveness
gr_edit .yaxis2.title.text = {}
gr_edit .yaxis2.title.text.Arrpush Share of Polarization Explained
gr_edit .plotregion1.plot1.style.editstyle line(color(black) width(thick)) editcopy
gr_edit .plotregion2.plot2.draw_view.setstyle, style(no)
gr_edit .title.style.editstyle color(black) editcopy
gr_edit .title.text = {}
gr_edit .title.text.Arrpush House
graph export "Figure2_House.png", replace as(png)

*Senate
clear
postutil clear
use "Senate.dta"
keep if south == 0
keep if eyear >= 1972
sum eyear
g time = (eyear - r(min))/(r(max) - r(min))
g extremism = cvp
replace extremism = -1*cvp if dem == 1
egen congress_party = group(eyear dem)
reghdfe extremism pres_memberparty, a(congress_party icpsr) cluster(icpsr)
outreg2 using "Table1Senate.txt", dec(3) 2aster replace
scalar A = _b[pres_memberparty]
areg extremism pres_memberparty, a(congress_party) cluster(icpsr)
outreg2 using "Table1Senate.txt", dec(3) 2aster append
scalar B = _b[pres_memberparty]
reg extremism time dem, cluster(icpsr)
outreg2 using "Table1Senate.txt", dec(3) 2aster append
scalar C = _b[time]
reg pres_memberparty time dem, cluster(icpsr)
outreg2 using "Table1Senate.txt", dec(3) 2aster append
scalar D = _b[time]
disp A/B
disp (B*D)/C
postfile Results responsiveness shareexplained year using "Results.dta", replace
forvalues i = 1972(2)2022 {
reg extremism pres_memberparty dem if eyear == `i', cluster(icpsr)
post Results (_b[pres_memberparty]) ((_b[pres_memberparty]*D)/C) (`i')
}
postclose Results
clear
use "Results.dta"
sum responsiveness
scalar min1 = r(min)
scalar max1 = r(max)
sum shareexplained
scalar min2 = r(min)
scalar max2 = r(max)
graph twoway (line responsiveness year, yaxis(1)) (line shareexplained year, yaxis(2))
gr_edit .yaxis1.reset_rule .4 1.8 .2, tickset(major) ruletype(range)
gr_edit .yaxis2.reset_rule .3 1.5 .2, tickset(major) ruletype(range)
gr_edit .yaxis1.plotregion.yscale.curmax = max1
gr_edit .yaxis1.plotregion.yscale.curmin = min1
gr_edit .yaxis2.plotregion.yscale.curmax = max2
gr_edit .yaxis2.plotregion.yscale.curmin = min2
gr_edit .style.editstyle margin(vsmall) boxstyle(shadestyle(color(white)) linestyle(color(white))) editcopy
gr_edit .legend.draw_view.setstyle, style(no)
gr_edit .xaxis1.reset_rule 1972 2012 10, tickset(major) ruletype(range) 
gr_edit .xaxis1.add_ticks 2020 `"2020"', tickset(major)
gr_edit .xaxis1.title.text = {}
gr_edit .xaxis1.title.text.Arrpush Election Year
gr_edit .yaxis1.style.editstyle majorstyle(gridstyle(linestyle(color(white)))) editcopy
gr_edit .xaxis1.style.editstyle majorstyle(gridstyle(linestyle(color(white)))) editcopy
gr_edit .yaxis1.title.text = {}
gr_edit .yaxis1.title.text.Arrpush Responsiveness
gr_edit .yaxis2.title.text = {}
gr_edit .yaxis2.title.text.Arrpush Share of Polarization Explained
gr_edit .plotregion1.plot1.style.editstyle line(color(black) width(thick)) editcopy
gr_edit .plotregion2.plot2.draw_view.setstyle, style(no)
gr_edit .title.style.editstyle color(black) editcopy
gr_edit .title.text = {}
gr_edit .title.text.Arrpush Senate
graph export "Figure2_Senate.png", as(png) replace


***Figure 4 and Table A1***
**House
clear
use "House.dta"
keep if south == 0
keep if eyear >= 1972
sum eyear
g time = (eyear - r(min))/(r(max) - r(min))
egen dist_cycle = group(dist cycle)
reg pres_memberparty time, cluster(dist_cycle)
outreg2 using "TableA1_House.txt", dec(3) 2aster replace
scalar A = _b[time]
*without nationalization
logit rep pres if eyear == 1972
predict p_rep1
g expected_pres1 = pres*(p_rep1) + -1*pres*(1 - p_rep1)
reg expected_pres1 time, cluster(dist_cycle)
outreg2 using "TableA1_House.txt", dec(3) 2aster append
scalar B = _b[time]
*without geographic polarization
forvalues i = 1972(2)2020 {
quietly {
logit rep pres if eyear == `i'
predict p_rep_`i' if eyear == 1972
}
}
preserve
keep if eyear == 1972
g id = _n
reshape long p_rep_, i(id) j(year)
drop time
sum year
g time = (year - r(min))/(r(max) - r(min))
g expected_pres2 = pres*(p_rep_) + -1*pres*(1 - p_rep_)
reg expected_pres2 time, cluster(dist_cycle)
outreg2 using "TableA1_House.txt", dec(3) 2aster append
scalar C = _b[time]
collapse expected_pres2, by(year)
rename year eyear
save "expected_pres2.dta", replace
restore
*within redistricting cycles
areg pres_memberparty time, a(cycle) cluster(dist_cycle)
outreg2 using "TableA1_House.txt", dec(3) 2aster append
scalar D = _b[time]
disp B/A
disp C/A
disp D/A
*figure
collapse expected_pres1 pres_memberparty, by(eyear)
merge 1:1 eyear using "expected_pres2.dta"
graph twoway (line pres_memberparty expected_pres1 expected_pres2 eyear)
gr_edit .style.editstyle margin(vsmall) boxstyle(shadestyle(color(white)) linestyle(color(white))) editcopy
gr_edit .legend.draw_view.setstyle, style(no)
gr_edit .xaxis1.reset_rule 1972 2012 10, tickset(major) ruletype(range) 
gr_edit .xaxis1.title.text = {}
gr_edit .xaxis1.title.text.Arrpush Year
gr_edit .yaxis1.title.text = {}
gr_edit .yaxis1.title.text.Arrpush Copartisan Leaning
gr_edit .yaxis1.style.editstyle majorstyle(gridstyle(linestyle(color(white)))) editcopy
gr_edit .xaxis1.style.editstyle majorstyle(gridstyle(linestyle(color(white)))) editcopy
gr_edit .plotregion1.plot1.style.editstyle line(color(black) width(thick)) editcopy
gr_edit .plotregion1.plot2.style.editstyle line(color(gs6) width(thick)) editcopy
gr_edit .plotregion1.plot3.style.editstyle line(color(gs12) width(thick)) editcopy
gr_edit .xaxis1.add_ticks 2020 `"2020"', tickset(major)
gr_edit .xaxis1.plotregion.xscale.curmax = 2021
gr_edit .plotregion1.AddTextBox added_text editor .125 2008
gr_edit .plotregion1.added_text_new = 1
gr_edit .plotregion1.added_text_rec = 1
gr_edit .plotregion1.added_text[1].style.editstyle  angle(default) size(medsmall) color(black) horizontal(left) vertical(middle) margin( gleft( sztype(relative) val(0) allow_pct(1)) gright( sztype(relative) val(0) allow_pct(1)) gtop( sztype(relative) val(0) allow_pct(1)) gbottom( sztype(relative) val(0) allow_pct(1))) linegap( sztype(relative) val(0) allow_pct(1)) drawbox(no) boxmargin( gleft( sztype(relative) val(0) allow_pct(1)) gright( sztype(relative) val(0) allow_pct(1)) gtop( sztype(relative) val(0) allow_pct(1)) gbottom( sztype(relative) val(0) allow_pct(1))) fillcolor(bluishgray) linestyle( width( sztype(relative) val(.2) allow_pct(1)) color(black) pattern(solid) align(inside)) box_alignment(east) editcopy
gr_edit .plotregion1.added_text[1].text = {}
gr_edit .plotregion1.added_text[1].text.Arrpush Actual
gr_edit .plotregion1.AddTextBox added_text editor .082 2003
gr_edit .plotregion1.added_text_new = 2
gr_edit .plotregion1.added_text_rec = 2
gr_edit .plotregion1.added_text[2].style.editstyle  angle(default) size(medsmall) color(gs6) horizontal(left) vertical(middle) margin( gleft( sztype(relative) val(0) allow_pct(1)) gright( sztype(relative) val(0) allow_pct(1)) gtop( sztype(relative) val(0) allow_pct(1)) gbottom( sztype(relative) val(0) allow_pct(1))) linegap( sztype(relative) val(0) allow_pct(1)) drawbox(no) boxmargin( gleft( sztype(relative) val(0) allow_pct(1)) gright( sztype(relative) val(0) allow_pct(1)) gtop( sztype(relative) val(0) allow_pct(1)) gbottom( sztype(relative) val(0) allow_pct(1))) fillcolor(bluishgray) linestyle( width( sztype(relative) val(.2) allow_pct(1)) color(black) pattern(solid) align(inside)) box_alignment(east) editcopy
gr_edit .plotregion1.added_text[2].text = {}
gr_edit .plotregion1.added_text[2].text.Arrpush Without Nationalization
gr_edit .plotregion1.AddTextBox added_text editor .055 2001
gr_edit .plotregion1.added_text_new = 3
gr_edit .plotregion1.added_text_rec = 3
gr_edit .plotregion1.added_text[3].style.editstyle  angle(default) size(medsmall) color(gs12) horizontal(left) vertical(middle) margin( gleft( sztype(relative) val(0) allow_pct(1)) gright( sztype(relative) val(0) allow_pct(1)) gtop( sztype(relative) val(0) allow_pct(1)) gbottom( sztype(relative) val(0) allow_pct(1))) linegap( sztype(relative) val(0) allow_pct(1)) drawbox(no) boxmargin( gleft( sztype(relative) val(0) allow_pct(1)) gright( sztype(relative) val(0) allow_pct(1)) gtop( sztype(relative) val(0) allow_pct(1)) gbottom( sztype(relative) val(0) allow_pct(1))) fillcolor(bluishgray) linestyle( width( sztype(relative) val(.2) allow_pct(1)) color(black) pattern(solid) align(inside)) box_alignment(east) editcopy
gr_edit .plotregion1.added_text[3].text = {}
gr_edit .plotregion1.added_text[3].text.Arrpush Without Geographic Polarization
gr_edit .title.style.editstyle color(black) editcopy
gr_edit .title.text = {}
gr_edit .title.text.Arrpush House
graph save "Alignment_Counterfactual_House.gph", replace

**Senate
clear
use "Senate.dta"
keep if south == 0
keep if eyear >= 1972
sum eyear
g time = (eyear - r(min))/(r(max) - r(min))
reg pres_memberparty time, cluster(state)
outreg2 using "TableA1_Senate.txt", dec(3) 2aster replace
scalar A = _b[time]
*without nationalization
logit rep pres if eyear == 1972
predict p_rep1
g expected_pres1 = pres*(p_rep1) + -1*pres*(1 - p_rep1)
reg expected_pres1 time, cluster(state)
outreg2 using "TableA1_Senate.txt", dec(3) 2aster append
scalar B = _b[time]
*without geographic polarization
forvalues i = 1972(2)2022 {
quietly {
logit rep pres if eyear == `i'
predict p_rep_`i' if eyear == 1972
}
}
preserve
keep if eyear == 1972
g id = _n
reshape long p_rep_, i(id) j(year)
drop time
sum year
g time = (year - r(min))/(r(max) - r(min))
g expected_pres2 = pres*(p_rep_) + -1*pres*(1 - p_rep_)
reg expected_pres2 time, cluster(state)
outreg2 using "TableA1_Senate.txt", dec(3) 2aster append
scalar C = _b[time]
collapse expected_pres2, by(year)
rename year eyear
save "expected_pres2.dta", replace
restore
disp B/A
disp C/A
*figure
collapse expected_pres1 pres_memberparty, by(eyear)
merge 1:1 eyear using "expected_pres2.dta"
graph twoway (line pres_memberparty expected_pres1 expected_pres2 eyear)
gr_edit .style.editstyle margin(vsmall) boxstyle(shadestyle(color(white)) linestyle(color(white))) editcopy
gr_edit .legend.draw_view.setstyle, style(no)
gr_edit .xaxis1.reset_rule 1972 2022 10, tickset(major) ruletype(range) 
gr_edit .xaxis1.title.text = {}
gr_edit .xaxis1.title.text.Arrpush Year
gr_edit .yaxis1.title.text = {}
gr_edit .yaxis1.title.text.Arrpush Copartisan Leaning
gr_edit .yaxis1.style.editstyle majorstyle(gridstyle(linestyle(color(white)))) editcopy
gr_edit .xaxis1.style.editstyle majorstyle(gridstyle(linestyle(color(white)))) editcopy
gr_edit .plotregion1.plot1.style.editstyle line(color(black) width(thick)) editcopy
gr_edit .plotregion1.plot2.style.editstyle line(color(gs6) width(thick)) editcopy
gr_edit .plotregion1.plot3.style.editstyle line(color(gs12) width(thick)) editcopy
gr_edit .xaxis1.plotregion.xscale.curmax = 2023
gr_edit .plotregion1.AddTextBox added_text editor .08 2012
gr_edit .plotregion1.added_text_new = 1
gr_edit .plotregion1.added_text_rec = 1
gr_edit .plotregion1.added_text[1].style.editstyle  angle(default) size(medsmall) color(black) horizontal(left) vertical(middle) margin( gleft( sztype(relative) val(0) allow_pct(1)) gright( sztype(relative) val(0) allow_pct(1)) gtop( sztype(relative) val(0) allow_pct(1)) gbottom( sztype(relative) val(0) allow_pct(1))) linegap( sztype(relative) val(0) allow_pct(1)) drawbox(no) boxmargin( gleft( sztype(relative) val(0) allow_pct(1)) gright( sztype(relative) val(0) allow_pct(1)) gtop( sztype(relative) val(0) allow_pct(1)) gbottom( sztype(relative) val(0) allow_pct(1))) fillcolor(bluishgray) linestyle( width( sztype(relative) val(.2) allow_pct(1)) color(black) pattern(solid) align(inside)) box_alignment(east) editcopy
gr_edit .plotregion1.added_text[1].text = {}
gr_edit .plotregion1.added_text[1].text.Arrpush Actual
gr_edit .plotregion1.AddTextBox added_text editor .036 2005
gr_edit .plotregion1.added_text_new = 2
gr_edit .plotregion1.added_text_rec = 2
gr_edit .plotregion1.added_text[2].style.editstyle  angle(default) size(medsmall) color(gs6) horizontal(left) vertical(middle) margin( gleft( sztype(relative) val(0) allow_pct(1)) gright( sztype(relative) val(0) allow_pct(1)) gtop( sztype(relative) val(0) allow_pct(1)) gbottom( sztype(relative) val(0) allow_pct(1))) linegap( sztype(relative) val(0) allow_pct(1)) drawbox(no) boxmargin( gleft( sztype(relative) val(0) allow_pct(1)) gright( sztype(relative) val(0) allow_pct(1)) gtop( sztype(relative) val(0) allow_pct(1)) gbottom( sztype(relative) val(0) allow_pct(1))) fillcolor(bluishgray) linestyle( width( sztype(relative) val(.2) allow_pct(1)) color(black) pattern(solid) align(inside)) box_alignment(east) editcopy
gr_edit .plotregion1.added_text[2].text = {}
gr_edit .plotregion1.added_text[2].text.Arrpush Without Nationalization
gr_edit .plotregion1.AddTextBox added_text editor .012 1995
gr_edit .plotregion1.added_text_new = 3
gr_edit .plotregion1.added_text_rec = 3
gr_edit .plotregion1.added_text[3].style.editstyle  angle(default) size(medsmall) color(gs12) horizontal(left) vertical(middle) margin( gleft( sztype(relative) val(0) allow_pct(1)) gright( sztype(relative) val(0) allow_pct(1)) gtop( sztype(relative) val(0) allow_pct(1)) gbottom( sztype(relative) val(0) allow_pct(1))) linegap( sztype(relative) val(0) allow_pct(1)) drawbox(no) boxmargin( gleft( sztype(relative) val(0) allow_pct(1)) gright( sztype(relative) val(0) allow_pct(1)) gtop( sztype(relative) val(0) allow_pct(1)) gbottom( sztype(relative) val(0) allow_pct(1))) fillcolor(bluishgray) linestyle( width( sztype(relative) val(.2) allow_pct(1)) color(black) pattern(solid) align(inside)) box_alignment(east) editcopy
gr_edit .plotregion1.added_text[3].text = {}
gr_edit .plotregion1.added_text[3].text.Arrpush Without Geographic Polarization
gr_edit .title.style.editstyle color(black) editcopy
gr_edit .title.text = {}
gr_edit .title.text.Arrpush Senate
graph save "Alignment_Counterfactual_Senate.gph", replace
graph combine "Alignment_Counterfactual_House.gph" "Alignment_Counterfactual_Senate.gph", col(1)
gr_edit .style.editstyle margin(vsmall) boxstyle(shadestyle(color(white)) linestyle(color(white))) editcopy
gr_edit .style.editstyle declared_ysize(9) editcopy
graph export "Figure4.png", replace as(png)


***Figure A2***
*House
clear
postutil clear
use "House.dta"
keep if south == 0
sum eyear
g time = (eyear - r(min))/(r(max) - r(min))
g extremism = cvp
replace extremism = -1*cvp if dem == 1
postfile Results both dem rep year using "Results.dta", replace
forvalues i = 1952(2)2020 {
reg extremism pres_memberparty if eyear == `i' & dem == 1
scalar res_d = _b[pres_memberparty]
reg extremism pres_memberparty if eyear == `i' & dem == 0
scalar res_r = _b[pres_memberparty]
reg extremism pres_memberparty dem if eyear == `i', cluster(icpsr)
post Results (_b[pres_memberparty]) (res_d) (res_r) (`i')
}
postclose Results
clear
use "Results.dta"
graph twoway line dem rep both year
gr_edit .style.editstyle margin(vsmall) boxstyle(shadestyle(color(white)) linestyle(color(white))) editcopy
gr_edit .legend.draw_view.setstyle, style(no)
gr_edit .xaxis1.reset_rule 1952 2012 10, tickset(major) ruletype(range) 
gr_edit .xaxis1.add_ticks 2020 `"2020"', tickset(major)
gr_edit .xaxis1.plotregion.xscale.curmax = 2021
gr_edit .xaxis1.title.text = {}
gr_edit .xaxis1.title.text.Arrpush Election Year
gr_edit .yaxis1.style.editstyle majorstyle(gridstyle(linestyle(color(white)))) editcopy
gr_edit .xaxis1.style.editstyle majorstyle(gridstyle(linestyle(color(white)))) editcopy
gr_edit .yaxis1.title.text = {}
gr_edit .yaxis1.title.text.Arrpush Responsiveness
gr_edit .plotregion1.plot1.style.editstyle line(color(blue) width(thick)) editcopy
gr_edit .plotregion1.plot2.style.editstyle line(color(red) width(thick)) editcopy
gr_edit .plotregion1.plot3.style.editstyle line(color(black) width(thick)) editcopy
gr_edit .title.text = {}
gr_edit .title.text.Arrpush House
graph save "ResponsivenessByParty_House.gph", replace
*Senate
clear
postutil clear
use "Senate.dta"
keep if south == 0
sum eyear
g time = (eyear - r(min))/(r(max) - r(min))
g extremism = cvp
replace extremism = -1*cvp if dem == 1
postfile Results both dem rep year using "Results.dta", replace
forvalues i = 1916(2)2022 {
reg extremism pres_memberparty if eyear == `i' & dem == 1
scalar res_d = _b[pres_memberparty]
reg extremism pres_memberparty if eyear == `i' & dem == 0
scalar res_r = _b[pres_memberparty]
reg extremism pres_memberparty dem if eyear == `i', cluster(icpsr)
post Results (_b[pres_memberparty]) (res_d) (res_r) (`i')
}
postclose Results
clear
use "Results.dta"
graph twoway line dem rep both year
gr_edit .style.editstyle margin(vsmall) boxstyle(shadestyle(color(white)) linestyle(color(white))) editcopy
gr_edit .legend.draw_view.setstyle, style(no)
gr_edit .xaxis1.reset_rule 1920 2020 10, tickset(major) ruletype(range)
gr_edit .xaxis1.title.text = {}
gr_edit .xaxis1.title.text.Arrpush Election Year
gr_edit .yaxis1.style.editstyle majorstyle(gridstyle(linestyle(color(white)))) editcopy
gr_edit .xaxis1.style.editstyle majorstyle(gridstyle(linestyle(color(white)))) editcopy
gr_edit .yaxis1.title.text = {}
gr_edit .yaxis1.title.text.Arrpush Responsiveness
gr_edit .plotregion1.plot1.style.editstyle line(color(blue) width(thick)) editcopy
gr_edit .plotregion1.plot2.style.editstyle line(color(red) width(thick)) editcopy
gr_edit .plotregion1.plot3.style.editstyle line(color(black) width(thick)) editcopy
gr_edit .title.text = {}
gr_edit .title.text.Arrpush Senate
graph save "ResponsivenessByParty_Senate.gph", replace
graph combine "ResponsivenessByParty_House.gph" "ResponsivenessByParty_Senate.gph", col(1)
gr_edit .style.editstyle margin(vsmall) boxstyle(shadestyle(color(white)) linestyle(color(white))) editcopy
gr_edit .style.editstyle declared_ysize(9) editcopy
graph export "FigureA2.png", replace as(png)


***Figure A3***
*House
clear
use "House.dta"
keep if south == 0
egen dist_year = group(dist eyear)
collapse (first) dist (mean) eyear dem cong, by(dist_year)
sort dist cong
g change = abs(dem - dem[_n-1]) if dist == dist[_n-1]
collapse change, by(eyear)
drop if (eyear - 2)/10 == round((eyear - 2)/10)
lpoly change eyear
gr_edit .style.editstyle margin(vsmall) boxstyle(shadestyle(color(white)) linestyle(color(white))) editcopy
gr_edit .legend.draw_view.setstyle, style(no)
gr_edit .xaxis1.reset_rule 1952 2012 10, tickset(major) ruletype(range) 
gr_edit .xaxis1.add_ticks 2020 `"2020"', tickset(major)
gr_edit .xaxis1.plotregion.xscale.curmax = 2021
gr_edit .xaxis1.title.text = {}
gr_edit .xaxis1.title.text.Arrpush Election Year
gr_edit .yaxis1.style.editstyle majorstyle(gridstyle(linestyle(color(white)))) editcopy
gr_edit .xaxis1.style.editstyle majorstyle(gridstyle(linestyle(color(white)))) editcopy
gr_edit .yaxis1.title.text = {}
gr_edit .yaxis1.title.text.Arrpush Partisan Turnover
gr_edit .note.draw_view.setstyle, style(no)
gr_edit .plotregion1.plot1.style.editstyle marker(fillcolor(gs8) linestyle(color(gs8))) editcopy
gr_edit .plotregion1.plot2.style.editstyle line(color(black) width(thick)) editcopy
gr_edit .title.style.editstyle color(black) editcopy
gr_edit .title.text = {}
gr_edit .title.text.Arrpush House
graph save "PartisanTurnover_House.gph", replace
*Senate
clear
use "Senate.dta"
keep if south == 0
egen state_year = group(state eyear)
collapse (first) state (mean) eyear dem cong, by(state_year)
sort state cong
g change = abs(dem - dem[_n-1]) if state == state[_n-1]
collapse change, by(eyear)
lpoly change eyear
gr_edit .style.editstyle margin(vsmall) boxstyle(shadestyle(color(white)) linestyle(color(white))) editcopy
gr_edit .legend.draw_view.setstyle, style(no)
gr_edit .xaxis1.reset_rule 1920 2020 10, tickset(major) ruletype(range) 
gr_edit .xaxis1.title.text = {}
gr_edit .xaxis1.title.text.Arrpush Election Year
gr_edit .yaxis1.style.editstyle majorstyle(gridstyle(linestyle(color(white)))) editcopy
gr_edit .xaxis1.style.editstyle majorstyle(gridstyle(linestyle(color(white)))) editcopy
gr_edit .yaxis1.title.text = {}
gr_edit .yaxis1.title.text.Arrpush Partisan Turnover
gr_edit .note.draw_view.setstyle, style(no)
gr_edit .plotregion1.plot1.style.editstyle marker(fillcolor(gs8) linestyle(color(gs8))) editcopy
gr_edit .plotregion1.plot2.style.editstyle line(color(black) width(thick)) editcopy
gr_edit .title.style.editstyle color(black) editcopy
gr_edit .title.text = {}
gr_edit .title.text.Arrpush Senate
graph save "PartisanTurnover_Senate.gph", replace
graph combine "PartisanTurnover_House.gph" "PartisanTurnover_Senate.gph", col(1)
gr_edit .style.editstyle margin(vsmall) boxstyle(shadestyle(color(white)) linestyle(color(white))) editcopy
gr_edit .style.editstyle declared_ysize(9) editcopy
graph export "FigureA3.png", replace as(png)


***Figure S1 and Figure S3***
*Senate
clear
use "Senate.dta"
g logitcoef = .
forvalues i = 1916(2)2022 {
logit rep pres if eyear == `i'
replace logitcoef = _b[pres] if eyear == `i'
}
g pres_demmembers = pres_memberparty if dem == 1
g pres_repmembers = pres_memberparty if rep == 1
g cvp_dem = cvp if dem == 1
g cvp_rep = cvp if rep == 1
collapse (mean) pres_memberparty pres_demmembers pres_repmembers cvp_dem cvp_rep logitcoef (sd) pres, by(eyear)
rename pres sdpres
rename pres_memberparty overall
rename pres_demmembers dems
rename pres_repmembers reps 
g polarization = cvp_rep - cvp_dem
sort eyear
graph twoway (line overall eyear, yaxis(1)) (line polarization eyear, yaxis(2))
gr_edit .style.editstyle margin(vsmall) boxstyle(shadestyle(color(white)) linestyle(color(white))) editcopy
gr_edit .legend.draw_view.setstyle, style(no)
gr_edit .xaxis1.reset_rule 1920 2020 10, tickset(major) ruletype(range) 
gr_edit .xaxis1.title.text = {}
gr_edit .xaxis1.title.text.Arrpush Election Year
gr_edit .yaxis1.style.editstyle majorstyle(gridstyle(linestyle(color(white)))) editcopy
gr_edit .xaxis1.style.editstyle majorstyle(gridstyle(linestyle(color(white)))) editcopy
gr_edit .yaxis1.title.text = {}
gr_edit .yaxis1.title.text.Arrpush Copartisan Leaning
gr_edit .yaxis2.title.text = {}
gr_edit .yaxis2.title.text.Arrpush Congressional Polarization
gr_edit .plotregion1.plot1.style.editstyle line(color(black) width(thick)) editcopy
gr_edit .plotregion2.plot2.style.editstyle line(color(gs8) width(thick)) editcopy
gr_edit .yaxis2.title.style.editstyle color(gs8) editcopy
gr_edit .yaxis2.style.editstyle majorstyle(tickstyle(linestyle(color(gs8)))) editcopy
gr_edit .yaxis2.style.editstyle majorstyle(tickstyle(textstyle(color(gs8)))) editcopy
gr_edit .yaxis2.style.editstyle majorstyle(use_labels(no)) editcopy
gr_edit .yaxis2.style.editstyle majorstyle(alternate(no)) editcopy
gr_edit .yaxis2.style.editstyle linestyle(color(gs8)) editcopy
gr_edit .title.style.editstyle color(black) editcopy
gr_edit .title.text = {}
gr_edit .title.text.Arrpush Senate
graph save "ConstituencyPartisanship_Polarization_Senate.gph", replace

sort eyear
graph twoway (line sdpres eyear, yaxis(1)) (line logitcoef eyear, yaxis(2))
gr_edit .style.editstyle margin(vsmall) boxstyle(shadestyle(color(white)) linestyle(color(white))) editcopy
gr_edit .legend.draw_view.setstyle, style(no)
gr_edit .xaxis1.reset_rule 1920 2020 10, tickset(major) ruletype(range)
gr_edit .xaxis1.title.text = {}
gr_edit .xaxis1.title.text.Arrpush Election Year
gr_edit .yaxis1.style.editstyle majorstyle(gridstyle(linestyle(color(white)))) editcopy
gr_edit .xaxis1.style.editstyle majorstyle(gridstyle(linestyle(color(white)))) editcopy
gr_edit .yaxis1.title.text = {}
gr_edit .yaxis1.title.text.Arrpush Geographic Polarization
gr_edit .yaxis2.title.text = {}
gr_edit .yaxis2.title.text.Arrpush Nationalized Voting
gr_edit .plotregion1.plot1.style.editstyle line(color(black) width(thick)) editcopy
gr_edit .plotregion2.plot2.style.editstyle line(color(gs8) width(thick)) editcopy
gr_edit .yaxis2.title.style.editstyle color(gs8) editcopy
gr_edit .yaxis2.style.editstyle majorstyle(tickstyle(linestyle(color(gs8)))) editcopy
gr_edit .yaxis2.style.editstyle majorstyle(tickstyle(textstyle(color(gs8)))) editcopy
gr_edit .yaxis2.style.editstyle majorstyle(use_labels(no)) editcopy
gr_edit .yaxis2.style.editstyle majorstyle(alternate(no)) editcopy
gr_edit .yaxis2.style.editstyle linestyle(color(gs8)) editcopy
gr_edit .title.style.editstyle color(black) editcopy
gr_edit .title.text = {}
gr_edit .title.text.Arrpush Senate
graph save "SD_Logit_Senate.gph", replace

*House
clear
use "House.dta"
g logitcoef = .
forvalues i = 1952(2)2020 {
logit rep pres if eyear == `i'
replace logitcoef = _b[pres] if eyear == `i'
}
g pres_demmembers = pres_memberparty if dem == 1
g pres_repmembers = pres_memberparty if rep == 1
g cvp_dem = cvp if dem == 1
g cvp_rep = cvp if rep == 1
collapse (mean) pres_memberparty pres_demmembers pres_repmembers cvp_dem cvp_rep logitcoef (sd) pres, by(eyear)
rename pres sdpres
rename pres_memberparty overall
rename pres_demmembers dems
rename pres_repmembers reps 
g polarization = cvp_rep - cvp_dem
sort eyear
graph twoway (line overall eyear, yaxis(1)) (line polarization eyear, yaxis(2))
gr_edit .style.editstyle margin(vsmall) boxstyle(shadestyle(color(white)) linestyle(color(white))) editcopy
gr_edit .legend.draw_view.setstyle, style(no)
gr_edit .xaxis1.reset_rule 1952 2012 10, tickset(major) ruletype(range) 
gr_edit .xaxis1.add_ticks 2020 `"2020"', tickset(major)
gr_edit .xaxis1.title.text = {}
gr_edit .xaxis1.title.text.Arrpush Election Year
gr_edit .yaxis1.style.editstyle majorstyle(gridstyle(linestyle(color(white)))) editcopy
gr_edit .xaxis1.style.editstyle majorstyle(gridstyle(linestyle(color(white)))) editcopy
gr_edit .yaxis1.title.text = {}
gr_edit .yaxis1.title.text.Arrpush Copartisan Leaning
gr_edit .yaxis2.title.text = {}
gr_edit .yaxis2.title.text.Arrpush Congressional Polarization
gr_edit .plotregion1.plot1.style.editstyle line(color(black) width(thick)) editcopy
gr_edit .plotregion2.plot2.style.editstyle line(color(gs8) width(thick)) editcopy
gr_edit .yaxis2.title.style.editstyle color(gs8) editcopy
gr_edit .yaxis2.style.editstyle majorstyle(tickstyle(linestyle(color(gs8)))) editcopy
gr_edit .yaxis2.style.editstyle majorstyle(tickstyle(textstyle(color(gs8)))) editcopy
gr_edit .yaxis2.style.editstyle majorstyle(use_labels(no)) editcopy
gr_edit .yaxis2.style.editstyle majorstyle(alternate(no)) editcopy
gr_edit .yaxis2.style.editstyle linestyle(color(gs8)) editcopy
gr_edit .title.style.editstyle color(black) editcopy
gr_edit .title.text = {}
gr_edit .title.text.Arrpush House
graph save "ConstituencyPartisanship_Polarization_House.gph", replace
graph combine "ConstituencyPartisanship_Polarization_House.gph" "ConstituencyPartisanship_Polarization_Senate.gph", col(1)
gr_edit .style.editstyle margin(vsmall) boxstyle(shadestyle(color(white)) linestyle(color(white))) editcopy
gr_edit .style.editstyle declared_ysize(9) editcopy
graph export "FigureS1.png", replace as(png)

sort eyear
graph twoway (line sdpres eyear, yaxis(1)) (line logitcoef eyear, yaxis(2))
gr_edit .style.editstyle margin(vsmall) boxstyle(shadestyle(color(white)) linestyle(color(white))) editcopy
gr_edit .legend.draw_view.setstyle, style(no)
gr_edit .xaxis1.reset_rule 1952 2012 10, tickset(major) ruletype(range) 
gr_edit .xaxis1.add_ticks 2020 `"2020"', tickset(major)
gr_edit .xaxis1.plotregion.xscale.curmax = 2021
gr_edit .xaxis1.title.text = {}
gr_edit .xaxis1.title.text.Arrpush Election Year
gr_edit .yaxis1.style.editstyle majorstyle(gridstyle(linestyle(color(white)))) editcopy
gr_edit .xaxis1.style.editstyle majorstyle(gridstyle(linestyle(color(white)))) editcopy
gr_edit .yaxis1.title.text = {}
gr_edit .yaxis1.title.text.Arrpush Geographic Polarization
gr_edit .yaxis2.title.text = {}
gr_edit .yaxis2.title.text.Arrpush Nationalized Voting
gr_edit .plotregion1.plot1.style.editstyle line(color(black) width(thick)) editcopy
gr_edit .plotregion2.plot2.style.editstyle line(color(gs8) width(thick)) editcopy
gr_edit .yaxis2.title.style.editstyle color(gs8) editcopy
gr_edit .yaxis2.style.editstyle majorstyle(tickstyle(linestyle(color(gs8)))) editcopy
gr_edit .yaxis2.style.editstyle majorstyle(tickstyle(textstyle(color(gs8)))) editcopy
gr_edit .yaxis2.style.editstyle majorstyle(use_labels(no)) editcopy
gr_edit .yaxis2.style.editstyle majorstyle(alternate(no)) editcopy
gr_edit .yaxis2.style.editstyle linestyle(color(gs8)) editcopy
gr_edit .title.style.editstyle color(black) editcopy
gr_edit .title.text = {}
gr_edit .title.text.Arrpush House
graph save "SD_Logit_House.gph", replace
graph combine "SD_Logit_House.gph" "SD_Logit_Senate.gph", col(1)
gr_edit .style.editstyle margin(vsmall) boxstyle(shadestyle(color(white)) linestyle(color(white))) editcopy
gr_edit .style.editstyle declared_ysize(9) editcopy
graph export "FigureS3.png", replace as(png)


***Table S1 and Figure S2***
*House
clear
postutil clear
use "House.dta"
keep if eyear >= 1972
sum eyear
g time = (eyear - r(min))/(r(max) - r(min))
g extremism = cvp
replace extremism = -1*cvp if dem == 1
egen congress_party = group(eyear dem)
reghdfe extremism pres_memberparty, a(congress_party icpsr) cluster(icpsr)
outreg2 using "TableS1House.txt", dec(3) 2aster replace
scalar A = _b[pres_memberparty]
areg extremism pres_memberparty, a(congress_party) cluster(icpsr)
outreg2 using "TableS1House.txt", dec(3) 2aster append
scalar B = _b[pres_memberparty]
reg extremism time dem, cluster(icpsr)
outreg2 using "TableS1House.txt", dec(3) 2aster append
scalar C = _b[time]
reg pres_memberparty time dem, cluster(icpsr)
outreg2 using "TableS1House.txt", dec(3) 2aster append
scalar D = _b[time]
disp A/B
disp (B*D)/C
postfile Results responsiveness shareexplained year using "Results.dta", replace
forvalues i = 1972(2)2020 {
reg extremism pres_memberparty dem if eyear == `i', cluster(icpsr)
post Results (_b[pres_memberparty]) ((_b[pres_memberparty]*D)/C) (`i')
}
postclose Results
clear
use "Results.dta"
sum responsiveness
scalar min1 = r(min)
scalar max1 = r(max)
sum shareexplained
scalar min2 = r(min)
scalar max2 = r(max)
graph twoway (line responsiveness year, yaxis(1)) (line shareexplained year, yaxis(2))
gr_edit .yaxis1.reset_rule .2 1 .2, tickset(major) ruletype(range)
gr_edit .yaxis2.reset_rule .2 .8 .2, tickset(major) ruletype(range)
gr_edit .yaxis1.plotregion.yscale.curmax = max1
gr_edit .yaxis1.plotregion.yscale.curmin = min1
gr_edit .yaxis2.plotregion.yscale.curmax = max2
gr_edit .yaxis2.plotregion.yscale.curmin = min2
gr_edit .style.editstyle margin(vsmall) boxstyle(shadestyle(color(white)) linestyle(color(white))) editcopy
gr_edit .legend.draw_view.setstyle, style(no)
gr_edit .xaxis1.reset_rule 1972 2012 10, tickset(major) ruletype(range) 
gr_edit .xaxis1.add_ticks 2020 `"2020"', tickset(major)
gr_edit .xaxis1.title.text = {}
gr_edit .xaxis1.title.text.Arrpush Election Year
gr_edit .yaxis1.style.editstyle majorstyle(gridstyle(linestyle(color(white)))) editcopy
gr_edit .xaxis1.style.editstyle majorstyle(gridstyle(linestyle(color(white)))) editcopy
gr_edit .yaxis1.title.text = {}
gr_edit .yaxis1.title.text.Arrpush Responsiveness
gr_edit .yaxis2.title.text = {}
gr_edit .yaxis2.title.text.Arrpush Share of Polarization Explained
gr_edit .plotregion1.plot1.style.editstyle line(color(black) width(thick)) editcopy
gr_edit .plotregion2.plot2.draw_view.setstyle, style(no)
gr_edit .title.style.editstyle color(black) editcopy
gr_edit .title.text = {}
gr_edit .title.text.Arrpush House
graph export "FigureS2_House.png", replace as(png)

*Senate
clear
postutil clear
use "Senate.dta"
keep if eyear >= 1972
sum eyear
g time = (eyear - r(min))/(r(max) - r(min))
g extremism = cvp
replace extremism = -1*cvp if dem == 1
egen congress_party = group(eyear dem)
reghdfe extremism pres_memberparty, a(congress_party icpsr) cluster(icpsr)
outreg2 using "TableS1Senate.txt", dec(3) 2aster replace
scalar A = _b[pres_memberparty]
areg extremism pres_memberparty, a(congress_party) cluster(icpsr)
outreg2 using "TableS1Senate.txt", dec(3) 2aster append
scalar B = _b[pres_memberparty]
reg extremism time dem, cluster(icpsr)
outreg2 using "TableS1Senate.txt", dec(3) 2aster append
scalar C = _b[time]
reg pres_memberparty time dem, cluster(icpsr)
outreg2 using "TableS1Senate.txt", dec(3) 2aster append
scalar D = _b[time]
disp A/B
disp (B*D)/C
postfile Results responsiveness shareexplained year using "Results.dta", replace
forvalues i = 1972(2)2022 {
reg extremism pres_memberparty dem if eyear == `i', cluster(icpsr)
post Results (_b[pres_memberparty]) ((_b[pres_memberparty]*D)/C) (`i')
}
postclose Results
clear
use "Results.dta"
sum responsiveness
scalar min1 = r(min)
scalar max1 = r(max)
sum shareexplained
scalar min2 = r(min)
scalar max2 = r(max)
graph twoway (line responsiveness year, yaxis(1)) (line shareexplained year, yaxis(2))
gr_edit .yaxis1.reset_rule .2 2.2 .4, tickset(major) ruletype(range)
gr_edit .yaxis2.reset_rule .1 1.3 .3, tickset(major) ruletype(range)
gr_edit .yaxis1.plotregion.yscale.curmax = max1
gr_edit .yaxis1.plotregion.yscale.curmin = min1
gr_edit .yaxis2.plotregion.yscale.curmax = max2
gr_edit .yaxis2.plotregion.yscale.curmin = min2
gr_edit .style.editstyle margin(vsmall) boxstyle(shadestyle(color(white)) linestyle(color(white))) editcopy
gr_edit .legend.draw_view.setstyle, style(no)
gr_edit .xaxis1.reset_rule 1972 2012 10, tickset(major) ruletype(range) 
gr_edit .xaxis1.add_ticks 2020 `"2020"', tickset(major)
gr_edit .xaxis1.title.text = {}
gr_edit .xaxis1.title.text.Arrpush Election Year
gr_edit .yaxis1.style.editstyle majorstyle(gridstyle(linestyle(color(white)))) editcopy
gr_edit .xaxis1.style.editstyle majorstyle(gridstyle(linestyle(color(white)))) editcopy
gr_edit .yaxis1.title.text = {}
gr_edit .yaxis1.title.text.Arrpush Responsiveness
gr_edit .yaxis2.title.text = {}
gr_edit .yaxis2.title.text.Arrpush Share of Polarization Explained
gr_edit .plotregion1.plot1.style.editstyle line(color(black) width(thick)) editcopy
gr_edit .plotregion2.plot2.draw_view.setstyle, style(no)
gr_edit .title.style.editstyle color(black) editcopy
gr_edit .title.text = {}
gr_edit .title.text.Arrpush Senate
graph export "FigureS2_Senate.png", as(png) replace


***Figure S4***
**House
clear
use "House.dta"
keep if eyear >= 1972
sum eyear
g time = (eyear - r(min))/(r(max) - r(min))
logit rep pres if eyear == 1972
predict p_rep1
g expected_pres1 = pres*(p_rep1) + -1*pres*(1 - p_rep1)
forvalues i = 1972(2)2020 {
quietly {
logit rep pres if eyear == `i'
predict p_rep_`i' if eyear == 1972
}
}
preserve
keep if eyear == 1972
g id = _n
reshape long p_rep_, i(id) j(year)
drop time
sum year
g time = (year - r(min))/(r(max) - r(min))
g expected_pres2 = pres*(p_rep_) + -1*pres*(1 - p_rep_)
collapse expected_pres2, by(year)
rename year eyear
save "expected_pres2.dta", replace
restore
collapse expected_pres1 pres_memberparty, by(eyear)
merge 1:1 eyear using "expected_pres2.dta"
graph twoway (line pres_memberparty expected_pres1 expected_pres2 eyear)
gr_edit .style.editstyle margin(vsmall) boxstyle(shadestyle(color(white)) linestyle(color(white))) editcopy
gr_edit .legend.draw_view.setstyle, style(no)
gr_edit .xaxis1.reset_rule 1972 2012 10, tickset(major) ruletype(range) 
gr_edit .xaxis1.title.text = {}
gr_edit .xaxis1.title.text.Arrpush Year
gr_edit .yaxis1.title.text = {}
gr_edit .yaxis1.title.text.Arrpush Copartisan Leaning
gr_edit .yaxis1.style.editstyle majorstyle(gridstyle(linestyle(color(white)))) editcopy
gr_edit .xaxis1.style.editstyle majorstyle(gridstyle(linestyle(color(white)))) editcopy
gr_edit .plotregion1.plot1.style.editstyle line(color(black) width(thick)) editcopy
gr_edit .plotregion1.plot2.style.editstyle line(color(gs6) width(thick)) editcopy
gr_edit .plotregion1.plot3.style.editstyle line(color(gs12) width(thick)) editcopy
gr_edit .xaxis1.add_ticks 2020 `"2020"', tickset(major)
gr_edit .xaxis1.plotregion.xscale.curmax = 2021
gr_edit .title.style.editstyle color(black) editcopy
gr_edit .title.text = {}
gr_edit .title.text.Arrpush House
graph save "Alignment_Counterfactual_House.gph", replace

**Senate
clear
use "Senate.dta"
keep if eyear >= 1972
sum eyear
g time = (eyear - r(min))/(r(max) - r(min))
logit rep pres if eyear == 1972
predict p_rep1
g expected_pres1 = pres*(p_rep1) + -1*pres*(1 - p_rep1)
forvalues i = 1972(2)2022 {
quietly {
logit rep pres if eyear == `i'
predict p_rep_`i' if eyear == 1972
}
}
preserve
keep if eyear == 1972
g id = _n
reshape long p_rep_, i(id) j(year)
drop time
sum year
g time = (year - r(min))/(r(max) - r(min))
g expected_pres2 = pres*(p_rep_) + -1*pres*(1 - p_rep_)
collapse expected_pres2, by(year)
rename year eyear
save "expected_pres2.dta", replace
restore
collapse expected_pres1 pres_memberparty, by(eyear)
merge 1:1 eyear using "expected_pres2.dta"
graph twoway (line pres_memberparty expected_pres1 expected_pres2 eyear)
gr_edit .style.editstyle margin(vsmall) boxstyle(shadestyle(color(white)) linestyle(color(white))) editcopy
gr_edit .legend.draw_view.setstyle, style(no)
gr_edit .xaxis1.reset_rule 1972 2022 10, tickset(major) ruletype(range) 
gr_edit .xaxis1.title.text = {}
gr_edit .xaxis1.title.text.Arrpush Year
gr_edit .yaxis1.title.text = {}
gr_edit .yaxis1.title.text.Arrpush Copartisan Leaning
gr_edit .yaxis1.style.editstyle majorstyle(gridstyle(linestyle(color(white)))) editcopy
gr_edit .xaxis1.style.editstyle majorstyle(gridstyle(linestyle(color(white)))) editcopy
gr_edit .plotregion1.plot1.style.editstyle line(color(black) width(thick)) editcopy
gr_edit .plotregion1.plot2.style.editstyle line(color(gs6) width(thick)) editcopy
gr_edit .plotregion1.plot3.style.editstyle line(color(gs12) width(thick)) editcopy
gr_edit .xaxis1.plotregion.xscale.curmax = 2023
gr_edit .title.style.editstyle color(black) editcopy
gr_edit .title.text = {}
gr_edit .title.text.Arrpush Senate
graph save "Alignment_Counterfactual_Senate.gph", replace
graph combine "Alignment_Counterfactual_House.gph" "Alignment_Counterfactual_Senate.gph", col(1)
gr_edit .style.editstyle margin(vsmall) boxstyle(shadestyle(color(white)) linestyle(color(white))) editcopy
gr_edit .style.editstyle declared_ysize(9) editcopy
graph export "FigureS4.png", replace as(png)


***Figure A4***
**House
clear
use "House.dta"
keep if eyear >= 1976
sum eyear
g time = (eyear - r(min))/(r(max) - r(min))
logit rep pres if eyear == 1976
predict p_rep1
g expected_pres1 = pres*(p_rep1) + -1*pres*(1 - p_rep1)
forvalues i = 1976(2)2020 {
quietly {
logit rep pres if eyear == `i'
predict p_rep_`i' if eyear == 1976
}
}
preserve
keep if eyear == 1976
g id = _n
reshape long p_rep_, i(id) j(year)
drop time
sum year
g time = (year - r(min))/(r(max) - r(min))
g expected_pres2 = pres*(p_rep_) + -1*pres*(1 - p_rep_)
collapse expected_pres2, by(year)
rename year eyear
save "expected_pres2.dta", replace
restore
collapse expected_pres1 pres_memberparty, by(eyear)
merge 1:1 eyear using "expected_pres2.dta"
graph twoway (line pres_memberparty expected_pres1 expected_pres2 eyear)
gr_edit .style.editstyle margin(vsmall) boxstyle(shadestyle(color(white)) linestyle(color(white))) editcopy
gr_edit .legend.draw_view.setstyle, style(no)
gr_edit .xaxis1.reset_rule 1976 2016 10, tickset(major) ruletype(range) 
gr_edit .xaxis1.title.text = {}
gr_edit .xaxis1.title.text.Arrpush Year
gr_edit .yaxis1.title.text = {}
gr_edit .yaxis1.title.text.Arrpush Copartisan Leaning
gr_edit .yaxis1.style.editstyle majorstyle(gridstyle(linestyle(color(white)))) editcopy
gr_edit .xaxis1.style.editstyle majorstyle(gridstyle(linestyle(color(white)))) editcopy
gr_edit .plotregion1.plot1.style.editstyle line(color(black) width(thick)) editcopy
gr_edit .plotregion1.plot2.style.editstyle line(color(gs6) width(thick)) editcopy
gr_edit .plotregion1.plot3.style.editstyle line(color(gs12) width(thick)) editcopy
gr_edit .xaxis1.plotregion.xscale.curmax = 2021
gr_edit .title.style.editstyle color(black) editcopy
gr_edit .title.text = {}
gr_edit .title.text.Arrpush House
graph save "Alignment_Counterfactual_House.gph", replace
**Senate
clear
use "Senate.dta"
keep if eyear >= 1976
sum eyear
g time = (eyear - r(min))/(r(max) - r(min))
logit rep pres if eyear == 1976
predict p_rep1
g expected_pres1 = pres*(p_rep1) + -1*pres*(1 - p_rep1)
forvalues i = 1976(2)2022 {
quietly {
logit rep pres if eyear == `i'
predict p_rep_`i' if eyear == 1976
}
}
preserve
keep if eyear == 1976
g id = _n
reshape long p_rep_, i(id) j(year)
drop time
sum year
g time = (year - r(min))/(r(max) - r(min))
g expected_pres2 = pres*(p_rep_) + -1*pres*(1 - p_rep_)
collapse expected_pres2, by(year)
rename year eyear
save "expected_pres2.dta", replace
restore
collapse expected_pres1 pres_memberparty, by(eyear)
merge 1:1 eyear using "expected_pres2.dta"
graph twoway (line pres_memberparty expected_pres1 expected_pres2 eyear)
gr_edit .style.editstyle margin(vsmall) boxstyle(shadestyle(color(white)) linestyle(color(white))) editcopy
gr_edit .legend.draw_view.setstyle, style(no)
gr_edit .xaxis1.reset_rule 1976 2016 10, tickset(major) ruletype(range) 
gr_edit .xaxis1.title.text = {}
gr_edit .xaxis1.title.text.Arrpush Year
gr_edit .yaxis1.title.text = {}
gr_edit .yaxis1.title.text.Arrpush Copartisan Leaning
gr_edit .yaxis1.style.editstyle majorstyle(gridstyle(linestyle(color(white)))) editcopy
gr_edit .xaxis1.style.editstyle majorstyle(gridstyle(linestyle(color(white)))) editcopy
gr_edit .plotregion1.plot1.style.editstyle line(color(black) width(thick)) editcopy
gr_edit .plotregion1.plot2.style.editstyle line(color(gs6) width(thick)) editcopy
gr_edit .plotregion1.plot3.style.editstyle line(color(gs12) width(thick)) editcopy
gr_edit .xaxis1.plotregion.xscale.curmax = 2023
gr_edit .title.style.editstyle color(black) editcopy
gr_edit .title.text = {}
gr_edit .title.text.Arrpush Senate
graph save "Alignment_Counterfactual_Senate.gph", replace
graph combine "Alignment_Counterfactual_House.gph" "Alignment_Counterfactual_Senate.gph", col(1)
gr_edit .style.editstyle margin(vsmall) boxstyle(shadestyle(color(white)) linestyle(color(white))) editcopy
gr_edit .style.editstyle declared_ysize(9) editcopy
graph export "FigureA4.png", replace as(png)



